<? $data = array(
    '1' => 'Accepted',
    '2' => 'Wrong answer',
    '3' => 'Time limit exceeded',
    '4' => 'Presentation Error',
    '5' => 'Compilation error',
    '6' => 'Memory limit exceeded',
    '7' => 'Runtime error',
    '8' => 'Compiling',
    '9' => 'Running',
    '10' => 'Waiting'
);
?>
<div id="activity_stats">
    <p> </p>
    <? if(count($this->paginator)): ?>
    <div class="widget">
        <div class="widget_title"><span class="iconsweet">&</span>
            <h5><?= $this->title; ?></h5>
        </div>
        <div class="widget_body">
            <table border="0" width="100%" class="activity_datatable" cellspacing="0" cellpadding="8">
                <tr>
                    <th width="5%"> ID </th>
                    <th width="10%"> Дата </th>
                    <th width="20%"> Автор </th>
                    <th width="20%"> Маселе </th>
                    <th width="10%"> Тил </th>
                    <th width="10%"> Жыйынтык </th>
                    <th width="10%"> Тест </th>
                    <th width="7%"> Убакыт </th>
                    <th width="7%"> Эс </th>
                </tr>
                <? foreach ($this->paginator as $value): ?>
                <tr>
                    <td> 
                        <? if (Zend_Auth::getInstance()->hasIdentity()) :?>
                            <? if(Zend_Auth::getInstance()->getIdentity()->user_id == $value['user_id']) : ?>
                                <a href="<?= $this->url(array(
                                    'controller' => 'status',
                                    'action' => 'source',
                                    'id' => $value['source_id']
                                )); ?>"> <?= $value['status_id']; ?> </a>

                            <? else :?>
                                <?= $value['status_id']; ?>
                            <? endif; ?>
                        <? else : ?>
                            <?= $value['status_id']; ?>
                        <? endif;?>
                    </td>
                    <td><?= date("d.m.Y H:i:s", $value['date']); ?></td>
                    <td><?= $value['user_name']; ?> <?=$value['user_surname']; ?>  </td>
                    <td><?= $value['problem_title']; ?></td>
                    <td> C++ <!--// $value['lang_prog_title']; --></td>
                    <td style="color:
                                    <? if ($value['result_id'] == 1) :?> 
                                        #008000 
                                    <? elseif ($value['result_id'] >= 2 && $value['result_id'] <= 7 ) :?> 
                                        #E3170D 
                                    <? endif; ?>">
                        <?= isset($data[$value['result_id']]) ? $data[$value['result_id']] : $data[10] ; ?>
                    </td>
                    <td> <? if ($value['result_id'] != 1) :?> <?= $value['test']; ?> <?endif;?> </td>
                    <td> <?= $value['time1']; ?> </td>
                    <td> <?= $value['memory1']; ?> Кб</td>
                </tr>
                <? endforeach; ?>
            </table>
        </div>
    </div>
        <?= $this->paginationControl($this->paginator, 'Sliding', 
                'partials/my_paginator.phtml'); ?>
    <? else :?>
        Пока еще отправленнх задач нет.
    <? endif ?>
</div>
